﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using Omu.Awesome.Mvc;
using DataAnnotationsExtensions;

namespace Qu.SeniorProject.Model
{
    [MetadataType(typeof(ProjectMetadata))]
    public partial class Project
    {
        [UIHint("Lookup")]
        [DisplayName("Students")]
        [Lookup(Paging = false, Controller = "StudentsLookup", Title = "Write some letters from the start, hit enter/click search", Multiselect = true, Fullscreen = true, ClearButton = true)]
        public IEnumerable<string> StudentIDs { get; set; }

        //public string Supervisor { get; set; }
        public int? SupervisorID { get; set; }

        [UIHint("AjaxDropdown")]
        [DisplayName("this is optional")]
        [AjaxDropdown(Controller = "CoSupervisorAjaxDropdown", ParentId = "SupervisorID")]
        public int? CoSupervisorID { get; set; }
    }

        public class ProjectMetadata
        {
            [UIHint("Hidden")]
            public int ProjectId { get; set; }

            [Required]
            [DisplayName("Project Title")]
            [StringLength(250, ErrorMessage = "250 Characters maximum")]
            public string ProjectTitle { get; set; }

            [Required]
            [DisplayName("Project Abstract")]
            [StringLength(5000, ErrorMessage = "5000 Characters maximum")]
            [UIHint("MultilineText")]
            [DataType(DataType.MultilineText)]
            public string ProjectDescription { get; set; }

            [UIHint("Hidden")]
            public int PeriodId { get; set; }

            //[UIHint("Hidden")]
            //public string Status { get; set; }
            //[UIHint("Hidden")]
            //public string SponsorOrganization { get; set; }
            //[UIHint("Hidden")]
            //public string SponsorContactName { get; set; }
            //[UIHint("Hidden")]
            //public string SponsorContactEmail { get; set; }
            //[UIHint("Hidden")]
            //public string SponsorContactPhone { get; set; }

            [StringLength(50, ErrorMessage = "50 Characters maximum")]
            [Email]
            public string CollaboratorContactEmail { get; set; }

            [UIHint("Hidden")]
            public Nullable<int> RelatedProjectId { get; set; }
            [UIHint("Hidden")]
            public Nullable<int> PresentationOrder { get; set; }
            [UIHint("Hidden")]
            public string PresentationTime { get; set; }
            [UIHint("Hidden")]
            public string Comment { get; set; }

            [UIHint("Hidden")]
            public string ReviewFeedback { get; set; }

            [DisplayName("Project Tasks")]
            [StringLength(1000, ErrorMessage = "1000 Characters maximum")]
            [UIHint("MultilineText")]
            public string ProjectTasks { get; set; }

            [DisplayName("Skills Required")]
            [StringLength(1000, ErrorMessage = "1000 Characters maximum")]
            [UIHint("MultilineText")]
            public string SkillsRequired { get; set; }

            [DisplayName("Resources Needed")]
            [StringLength(1000, ErrorMessage = "1000 Characters maximum")]
            [UIHint("MultilineText")]
            public string ResourcesNeeded { get; set; }

            [UIHint("Hidden")]
            public string ProposalURL { get; set; }

        }

}
